aboutsummaryrefslogtreecommitdiff
path: root/src/pages/portfolio/[id].astro
blob: b92ecbda298f2f4526c4311c22e3233bbd5a67f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
import Layout from "../../layouts/Layout.astro";
import { getCollection, render } from "astro:content";
import { type GetStaticPaths } from "astro";
import TechnologyBadge from "../../partials/TechnologyBadge.astro";

interface Props {
  entry: any;
}

export const getStaticPaths: GetStaticPaths = async () => {
  const entries = await getCollection("portfolio");
  return entries.map((entry: any) => ({
    params: { id: entry.id },
    props: { entry },
  }));
};

const { entry } = Astro.props;
const { Content } = await render(entry);
---

<Layout title={entry.data.title} description={entry.data.description}>
  <a id="link-back" href="/portfolio">
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      stroke-width="2"
      stroke-linecap="round"
      stroke-linejoin="round"
      class="w-6 h-6 inline-block mr-2"
    >
      <polyline points="15 18 9 12 15 6"></polyline>
    </svg>
    Volver al portfolio
  </a>

  <h1>{entry.data.title}</h1>

  <Content />

  <h2>Tecnologías utilizadas</h2>

  {
    entry.data.technologies.map((technology: string) => (
      <TechnologyBadge size="small" code={technology} />
    ))
  }
</Layout>

<style>
  a#link-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.2s ease-in-out;
  }

  a#link-back svg {
    height: 1em;
  }
</style>